# Maintainer: Jiachen YANG <farseerfc@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: xyzzy <628208@gmail.com>

pkgname=flameshot
pkgver=12.1.0
pkgrel=3
pkgdesc="Powerful yet simple to use screenshot software"
arch=('loong64' 'x86_64')
url="https://github.com/flameshot-org/flameshot"
license=('GPL')
depends=('qt5-svg' 'hicolor-icon-theme' 'kguiaddons5')
makedepends=('make' 'qt5-tools' 'cmake')
optdepends=(
    'gnome-shell-extension-appindicator: for system tray icon if you are using Gnome'
    'grim: for wlroots wayland support'
    'xdg-desktop-portal: for wayland support, you will need the implementation for your wayland desktop environment'
)
source=("${pkgname}-v${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=('c82c05d554e7a6d810aca8417ca12b21e4f74864455ab4ac94602668f85ac22a')

build() {
  cmake -B build -S "${pkgname}-${pkgver}" \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DUSE_WAYLAND_CLIPBOARD=1 \
    -Wno-dev
  cmake --build build
}

package() {
  DESTDIR="${pkgdir}" cmake --install build

  # zsh _flameshot completion is provided by zsh-completions so exclude from packaging
  rm -rf ${pkgdir}/usr/share/zsh/
}
